As a conventional technique for automatically correcting tones of an image, a method as follows has been well known. That is, a luminance value or a density value of each pixel of an input image is calculated, a histogram indicating the sum of pixels having the same value is formed, and all pixels are subjected to such a correction process that optimizes the shape of the histogram.
For example, Japanese Published Patent Application No. Hei.6-268866 discloses a method for performing correction using a histogram as mentioned above. The method disclosed in this literature will be described with reference to FIGS. 40(a)–40(c). In the following description, it is assumed that each pixel of a digital image has a density value ranging from “0” to “255”.
Initially, a density value of each pixel is calculated from a digital image signal, and a density histogram indicating the sum of pixels having the same density value is formed. An example of this histogram is shown in FIG. 40(a). Next, assuming that the minimum density value of the created density histogram is dmin, the maximum density value is dmax, the number of pixels having a pixel density d is F1[d], and the number of pixels after conversion is F2[d], a histogram which is corrected so as to expand a pixel density distribution area over the whole pixel luminance (refer to FIG. 40(b)) is formed according to formula (1) as follows and, simultaneously, a point (center of gravity) G which divides the area of the histogram into two equal parts is calculated. Thereafter, as shown in FIG. 40(c), a γ value at which the center of gravity G is positioned in the center of the density range is obtained. Assuming that the number of pixels after conversion of the F2[d] is expressed by F3[d], a histogram which is subjected to γ correction is formed according to formula (2) as follows, and correction is carried out on the basis of the histogram.F2[d]=F1[d×{(dmax−dmin)/255+dmin}]  (1)
                              F3          ⁡                      [            d            ]                          =                  F2          [                                    (                              d                /                256                            )                                      1              γ                                ]                                    (        2        )            
In this way, the distribution of pixel densities is expanded over all tones, evenly from the center tone to the both sides, whereby the brightness is adjusted so that the center of gravity of the density distribution is positioned in the center.
Meanwhile, Japanese Published Patent Application No. 2000-102033 discloses another method for performing tone correction on an image using a histogram. This method will be described with reference to FIG. 41.
In this method, an input luminance level axis, which is calculated for a luminance histogram generated from a digital image signal, is divided into equal n regions (n: integer that satisfies n>3), and feature parameters, such as a ratio of the number of pixels in each region to all pixels, a ratio of the number of pixels in each region exceeding a predetermined limit value to all pixels, and a radio of the number of pixels in each of three equal regions into which the input luminance-level axis is divided, are captured (step 2501). Next, various kinds of curve data which have previously been formed are captured (step 2502). Then, the process is branched into different processes (case branching) in step 2503 and step 2505 on the basis of the feature parameters, and a tone correction curve is formed from the feature parameters and curve data, which are captured in steps 2501 and 2502, by under processing (step 2504), over processing (step 2506), or linear processing (step 2507), and tone correction curve data is stored (step 2508). Then, tone correction is carried out on the basis of the tone correction curve so obtained.
That is, in this method, the correction process is branched into different processes according to the shape of the luminance histogram of the input image, and a tone correction curve is formed by a process most suited to the input image, and then tone correction is carried out on the basis of the tone correction curve.
As described above, according to the tone correction method disclosed in Japanese Published Patent Application No. Hei.6-268866, even when an input image includes a lot of halftones, a sharp-contrast image can be obtained.
On the other hand, according to the tone correction method disclosed in Japanese Published Patent Application No. 2000-102033, an image of improved quality is obtained as compared with the case of using the accumulated luminance distribution as it is. Further, since the correction process can be implemented by software, it can easily deal with an alteration of image data or the like.
However, the tone correction method disclosed in Japanese Published Patent Application No. Hei.6-268866 has a drawback as follows. Although, in this method, γ correction is carried to bring the center of gravity of the histogram to the center of tones, when two peaks are generated on the low-tone side and the high-tone side of the histogram as in a back-lighted imager correction is hardly carried out because the center of gravity of the histogram is originally positioned in the vicinity of the center tone. Consequently, the back-lighted area of the image is not corrected at all.
Furthermore, as for a natural image such as a scenic shot, a natural image having a histogram the center of gravity of which is in the vicinity of the center tone is not always beautiful. For example, when an image including a person who wears black clothes is corrected, the clothes unfavorably turn to gray.
On the other hand, in the tone correction method disclosed in Japanese Published Patent Application No. 2000-102033, appropriate tone correction is carried out by branching the correction process according to the shape of the luminance histogram of the input image. In this method, however, accurate case branching is required, whereby the process is complicated and the volume of calculation is increased.
Moreover, different correction processes must be prepared for the respective cases, whereby the required storage capacity is increased, and the scale of the correction apparatus is increased, resulting in an increase in costs.
Furthermore, in the above-described methods, when a person exists in the center of the image and the area occupied by the person is small, since information of the person is hardly included in the histogram, an unintended correction is carried out, whereby a skin color region such as a face, which is visually conspicuous, occurs halation.